package com.scs.application.modules.fsd.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.DataEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 */
@Data
@Accessors(chain = true)
@EntityClassAnnotation(remark = "智能柜日志表")
@TableName("fsd_log")
public class FsdLog extends DataEntity {

    @EntityFieldAnnotation(
            text = "业务类型",
            length = "30",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String busType;

    @EntityFieldAnnotation(
            text = "业务主键",
            length = "30",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String busKey;

    @EntityFieldAnnotation(
            text = "日志类型",
            length = "30",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String logType;

    @EntityFieldAnnotation(
            text = "",
            length = "30",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String creatorName;

    @EntityFieldAnnotation(
            text = "日志信息",
            type = EntityFieldType.TEXT,
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String msg;

    @EntityFieldAnnotation(
            text = "参数",
            type = EntityFieldType.TEXT,
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String param;

    public static FsdLog getLog(String busType,String busKey,String logType,String creatorName,String msg,String param){
        FsdLog log = new FsdLog();
        log.setBusType(busType);
        log.setBusKey(busKey);
        log.setLogType(logType);
        log.setCreatorName(creatorName);
        log.setMsg(msg);
        log.setParam(param);
        return log;
    }
}
